package com.wenhao.bluelake;

import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-09-04 9:49
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        int[] dp = new int[n];
        dp[0] = 1;
        int result = 0;
        int count = 0;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if (array[j] < array[i]) {
                    if (dp[i] == dp[j] + 1) {
                        count++;
                    }
                    if (dp[i] < dp[j] + 1) {
                        {
                            dp[i] = dp[j] + 1;
                            count = 1;
                        }
                    }
                }
                if (dp[i] > result) {
                    result = dp[i];
                    count = 1;
                }
            }
        }
        System.out.println(result + " " + count);
    }
}
